
<%@ page language="java" pageEncoding="GBK"%>
<%@ include file="/common/taglibs.jsp"%>

<c:out value="${current_location}" escapeXml="false" />

<c:set var="buttons">
<div align="right">
    <input type="button" class="button" onclick="location.href='<c:url value="editPerson.do"/>'" value="<fmt:message key="button.add"/>"/>
</div>
</c:set>

<c:out value="${buttons}" escapeXml="false"/>
  <table width="100%">
 		<tr class="tr_pagenumber">
            <td  align="right">
                <%@include file="/common/pageHeader.jsp"%>
            </td>
        </tr>
	</table>
<table cellspacing="1" class="tb_datalist" name="personList" id="personList">
    <thead>
       
        <tr class="tr_detail">

            <th>
                <fmt:message key="personForm.id" />
            </th>

            <th>
                <fmt:message key="personForm.name" />
            </th>

            <th>
                <fmt:message key="personForm.age" />
            </th>

            <th>
                <fmt:message key="button.operation"/>
            </th>
        </tr>
    </thead>

    <c:if test="${not empty objectList}">
        <tbody>
            <c:forEach var="object" items="${objectList}" varStatus="status">
                <c:choose>
                    <c:when test="${status.count mod 2 == 0}">
                        <c:set var="trClass" value="odd"/>
                    </c:when>
                    <c:otherwise>
                        <c:set var="trClass" value="even"/>
                    </c:otherwise>
                </c:choose>

                <tr class="${trClass}">

                    <td>
                        ${object.id}
                    </td>

                    <td>
                        ${object.name}
                    </td>

                    <td>
                        ${object.age}
                    </td>

                    <td>

                        <html:link href="###" onclick="javascript:goPage('editPerson.do?id=${object.id}')">
                            <fmt:message key="button.edit" />
                        </html:link>
                        <html:link href="###" onclick="javascript:if (confirmDelete('person')) {goPage('deletePerson.do?id=${object.id}')}">
                            <fmt:message key="button.delete" />
                        </html:link>

                    </td>

                </tr>
            </c:forEach>
        </tbody>
    </c:if>


</table>
  <table width="100%">
 		<tr class="tr_pagenumber">
            <td  align="right">
                <%@include file="/common/pageFooter.jsp"%>
            </td>
        </tr>
	</table>
<script type="text/javascript">
    highlightTableRows("personList");
</script>